package com.yonyou.brigade.third_parties.tujia.controller;

import com.yonyou.brigade.third_parties.tujia.service.ITuJiaSSOService;
import com.yonyou.brigade.third_parties.tujia.service.ITujiaOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/tujia")
public class TujiaOrderTestController {

    @Autowired
    @Qualifier("tujiaOrderServiceImpl")
    private ITujiaOrderService TujiaOrderService;


    @Autowired
    @Qualifier("tujiaSSOServiceImpl")
    private ITuJiaSSOService tuJiaSSOService;

    @RequestMapping(value = "/getTujiaOrderList",method = RequestMethod.POST)
    public void testOrders() {
        String tenant = "ft9fbcrw";
        String orgpk = "0001A210000000003ADC";
        String begin = "2018-08-14 00:00:00";
        String end = "2018-09-13 14:48:28";
        String phone = "13611113456";
        int channelId = 29;
        TujiaOrderService.getTujiaOrderList(tenant,orgpk,null,begin,end,10,0,channelId);
    }

    @RequestMapping(value = "/sso",method = RequestMethod.POST)
    public void testSSO() {
        String tenant = "ft9fbcrw";
        String phone = "15901062973";
        String result= tuJiaSSOService.getSSOUrl(tenant,phone);
        System.out.println(result);
    }
}
